package com.qf.admin.controller.system;

import com.qf.admin.domain.vo.RouteVO;
import com.qf.admin.service.system.SysMenuService;
import com.qf.common.aspect.ApiOperationLog;
import com.qf.common.core.domain.ResponseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: sin
 * @Date: 2024/10/13 16:12
 * @Description:
 **/
@RestController
@RequestMapping("/admin/router")
public class RouterController {

    @Resource
    private SysMenuService sysMenuService;

    @ApiOperation(value = "获取路由")
    @ApiOperationLog(description = "获取路由")
    @GetMapping("/getRouter")
    public ResponseResult<List<RouteVO>> getRouter() {
        List<RouteVO> menus = sysMenuService.buildRouterTree();
        return ResponseResult.success(menus);
    }
}

